package main
import (
	"github.com/julienschmidt/httprouter"
	"net/http"
	"streamMedia/Controller"
)
// handler -> validation{1.request, 2.user} -> business logic -> response.
func main(){
	r := RouterHandler()
	http.ListenAndServe(":8000", r)
}

func RouterHandler() *httprouter.Router {
	router := httprouter.New()
	router.POST("/user", Controller.CreateUser)
	router.POST("/user/:user_name", Controller.Login)
	router.GET("user/:username/videos", Controller.GetVideoList)
	router.GET("user/:username/videos/:vid-id", Controller.GetVideoOne)
	router.DELETE("/user/:username/videos/:vid-id", Controller.DeleteVideoId)
	router.GET("/videos/:vid-id/comments", Controller.ShowComments)
	router.POST("/videos/:vid-id/comments", Controller.PostAComment)
	router.DELETE("/videos/:vid-id/comment/:comment-id",Controller.DeleteAComment)


	return router
}